<?php
/**
 * Gold - Repay
 * 
 * NOTICE OF LICENSE
 * 
 * This source file is subject to the Gold Repay POINTS AND REWARDS 
 * License, which extends the Open Software License (OSL 3.0).
 * The Repay License is available at this URL: 
 * 
 * DISCLAIMER
 * 
 * By adding to, editing, or in any way modifying this code, Gold is 
 * not held liable for any inconsistencies or abnormalities in the 
 * behaviour of this code. 
 * By adding to, editing, or in any way modifying this code, the Licensee
 * terminates any agreement of support offered by Gold, outlined in the 
 * provided Repay License. 
 * Upon discovery of modified code in the process of support, the Licensee 
 * is still held accountable for any and all billable time Gold spent 
 * during the support process.
 * Gold does not guarantee compatibility with any other framework extension. 
 * Gold is not responsbile for any inconsistencies or abnormalities in the
 * behaviour of this code if caused by other framework extension.
 * If you did not receive a copy of the license, please send an email to 
 * contact@Gold.ca or call 1-888-699-Gold(9322), so we can send you a copy 
 * immediately.
 * 
 * @category    Gold
 * @package     Gold_Repay
 * @copyright   Copyright (c) 2011 Gold
 * @Author $Id: config.xml 11 2011-06-22 09:19:46Z gold $
 */
class Gold_Repay_Model_Rewards_Rewardspent extends Gold_Repay_Model_Order_Address_Total_Abstract {
	
	public function __construct() {
		$this->setCode ( 'rewardspent' );
	}
	
	public function fetch(Gold_Repay_Model_Order_Address $address) {		
		$order = $address->getOrder ();
		$points_spent = $order->getTotalSpentPoints ();		
		$address->addTotal ( array ('code' => $this->getCode (), 'title' => Mage::helper ( 'sales' )->__ ( 'Points Spent' ), 'value'=>$points_spent ) );
		return $this;
	}
	
}